Skip to content

[Backport 8.13] Add misc improvements to the framework - #761

Merged
swallez merged 1 commit into
8.13from
backport-760-to-8.13
Mar 12, 2024
Merged

[Backport 8.13] Add misc improvements to the framework#761
swallez merged 1 commit into
8.13from
backport-760-to-8.13

Conversation

@github-actions

Copy link
Copy Markdown

Backport b5aed69 from #760

Adds a number of improvements and bugfixes to the JSON and utility classes:

JSON framework:

* A new `BufferingJsonpMapper` allows the creation of `JsonGenerator` that store JSON events in a buffer that can be replayed. This is useful to efficiently create synthetic JSON documents.
* An additional `JsonpMapper.deserialize` method variant accepts the current JSON event. Fixes #741
* The Jackson implementation of `JsonpMapper` now enables the `ACCEPT_SINGLE_VALUE_AS_ARRAY` deserialization feature. This allows single values in a JSON stream to be considered as a single-value collection.

API & transport framework:

* `ElasticsearchException` now holds the low level http response, so that the application can inspect the details of the error.
* Endpoints now have a `call` methods, to make calling endpoints programmatically easier. This is for advanced use, as an application will normally use the `ElasticsearchClient` that hides endpoint objects.
* A `BinaryDataResponse` can now easily be created from a byte array.

Test framework:

* The `ElasticsearchTestServer` now tries to contact an Elasticsearch server running on `http://elastic:changeme@localhost:9200` before spawning a container.
* A `MockHttpClient` has been added that allows writing integration-like tests without requiring a running server. This is an alternative to using `com.sun.net.httpserver.HttpServer` when we want to test http response decoding but don't need to test the network layer.
@swallez
swallez merged commit 7bec154 into 8.13 Mar 12, 2024
@swallez
swallez deleted the backport-760-to-8.13 branch March 12, 2024 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant